package logMonitor.bolt;

import backtype.storm.topology.BasicOutputCollector;
import backtype.storm.topology.OutputFieldsDeclarer;
import backtype.storm.topology.base.BaseBasicBolt;
import backtype.storm.tuple.Tuple;
import logMonitor.domain.Message;
import logMonitor.utils.MonitorHandler;

/**
 * Created by lenovo on 2018/1/11.
 */
public class TriggerMessage  extends BaseBasicBolt {
    @Override
    public void execute(Tuple input, BasicOutputCollector basicOutputCollector) {
        Message message = (Message) input.getValueByField("message");
        MonitorHandler.trigger(message);
    }

    @Override
    public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) {

    }
}
